package Pages.System;

import Data.Util;
import Pages.Class.ClassAddPage;
import Pages.Class.ClassDeletePage;
import Pages.Class.ClassModifyPage;
import Pages.Class.ClassSelectPage;
import Pages.Course.CourseAddPage;
import Pages.Course.CourseDeletePage;
import Pages.Course.CourseModifyPage;
import Pages.Course.CourseSelectPageT;
import Pages.CourseChoose.TCourseChoosePage;
import Pages.CourseChooseDelete.TCourseChooseDeletePage;
import Pages.Score.ScoreAddPage;
import Pages.Score.ScoreDeletePage;
import Pages.Score.ScoreModifyPage;
import Pages.Score.ScoreSelectPageT;
import Pages.Student.StudentAddPage;
import Pages.Student.StudentDeletePage;
import Pages.Student.StudentModifyPage;
import Pages.Student.StudentSelectPage;
import Pages.User.UserSelectPageT;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ResourceBundle;

/**
 * description:
 * author: 柳胜酉
 * 2022/7/10
 */
public class THomePage extends JFrame {
    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    private JPanel dialogPane;
    private JPanel contentPanel;
    private JPanel panel1;
    private JMenuBar menuBar4;
    private JMenu menu7;
    private JMenuItem menuItem1;
    private JMenuItem menuItem2;
    private JMenuItem menuItem3;
    private JMenuItem menuItem4;
    private JMenu menu8;
    private JMenuItem menuItem5;
    private JMenuItem menuItem6;
    private JMenuItem menuItem7;
    private JMenuItem menuItem8;
    private JMenu menu9;
    private JMenuItem menuItem9;
    private JMenuItem menuItem10;
    private JMenuItem menuItem11;
    private JMenuItem menuItem12;
    private JMenu menu10;
    private JMenuItem menuItem13;
    private JMenuItem menuItem14;
    private JMenuItem menuItem15;
    private JMenuItem menuItem16;
    private JMenu menu11;
    private JMenuItem menuItem17;
    private JMenuItem menuItem18;
    private JMenuItem menuItem19;
    private JMenuItem menuItem20;
    private JMenu menu12;
    private JMenuItem menuItem23;
    private JMenuItem menuItem22;
    private JMenuItem menuItem21;
    private JPanel panel7;
    private JPanel panel8;
    private JPanel panel9;
    private JPanel panel21;
    private JLabel label10;
    private JPanel panel16;
    private JButton button2;
    private JPanel panel17;
    private JButton button3;
    private JPanel panel18;
    private JButton button4;
    private JPanel panel19;
    private JButton button5;
    private JPanel panel2;
    private JPanel panel3;
    private JPanel panel4;
    private JLabel label1;
    private JLabel label2;
    private JPanel panel5;
    private JLabel label3;
    public THomePage() {
        initComponents();
    }

    private void initComponents() {
        ResourceBundle bundle = ResourceBundle.getBundle("P0704");
        dialogPane = new JPanel();
        contentPanel = new JPanel();
        panel1 = new JPanel();
        menuBar4 = new JMenuBar();
        menu7 = new JMenu();
        menuItem1 = new JMenuItem();
        menuItem2 = new JMenuItem();
        menuItem3 = new JMenuItem();
        menuItem4 = new JMenuItem();
        menu8 = new JMenu();
        menuItem5 = new JMenuItem();
        menuItem6 = new JMenuItem();
        menuItem7 = new JMenuItem();
        menuItem8 = new JMenuItem();
        menu9 = new JMenu();
        menuItem9 = new JMenuItem();
        menuItem10 = new JMenuItem();
        menuItem11 = new JMenuItem();
        menuItem12 = new JMenuItem();
        menu10 = new JMenu();
        menuItem13 = new JMenuItem();
        menuItem14 = new JMenuItem();
        menuItem15 = new JMenuItem();
        menuItem16 = new JMenuItem();
        menu11 = new JMenu();
        menuItem17 = new JMenuItem();
        menuItem18 = new JMenuItem();
        menuItem19 = new JMenuItem();
        menuItem20 = new JMenuItem();
        menu12 = new JMenu();
        menuItem23 = new JMenuItem();
        menuItem22 = new JMenuItem();
        menuItem21 = new JMenuItem();
        panel7 = new JPanel();
        panel8 = new JPanel();
        panel9 = new JPanel();
        panel21 = new JPanel();
        label10 = new JLabel();
        panel16 = new JPanel();
        button2 = new JButton();
        panel17 = new JPanel();
        button3 = new JButton();
        panel18 = new JPanel();
        button4 = new JButton();
        panel19 = new JPanel();
        button5 = new JButton();
        panel2 = new JPanel();
        panel3 = new JPanel();
        panel4 = new JPanel();
        label1 = new JLabel();
        label2 = new JLabel();
        panel5 = new JPanel();
        label3 = new JLabel();

        //======== this ========
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setTitle("\u4e3b\u9875");
        setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
        setMaximizedBounds(null);
        setBackground(SystemColor.activeCaption);
        setMinimumSize(new Dimension(810, 535));
        var contentPane = getContentPane();
        contentPane.setLayout(new BorderLayout());

        /**
         * 全屏设置
         * true无边框 全屏显示
         * false有边框 全屏显示
         */
        setUndecorated(false);
        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
        setSize(d.width, d.height);
        setLocationRelativeTo(null);

        //======== dialogPane ========
        {
            dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));
            dialogPane.setBackground(SystemColor.inactiveCaption);
            dialogPane.setLayout(new BorderLayout());

            //======== contentPanel ========
            {
                contentPanel.setBackground(SystemColor.activeCaption);
                contentPanel.setLayout(new GridLayout());

                //======== panel1 ========
                {
                    panel1.setBackground(SystemColor.inactiveCaption);
                    panel1.setLayout(new BorderLayout());

                    //======== menuBar4 ========
                    {
                        menuBar4.setBackground(SystemColor.inactiveCaption);

                        //======== menu7 ========
                        {
                            menu7.setText(bundle.getString("HomePage.menu7.text"));
                            menu7.setFont(menu7.getFont().deriveFont(menu7.getFont().getSize() + 10f));
                            menu7.setBackground(SystemColor.activeCaption);

                            //---- menuItem1 ----
                            menuItem1.setText(bundle.getString("HomePage.menuItem1.text"));
                            menuItem1.setFont(menuItem1.getFont().deriveFont(menuItem1.getFont().getSize() + 5f));
                            menu7.add(menuItem1);

                            //---- menuItem2 ----
                            menuItem2.setText(bundle.getString("HomePage.menuItem2.text"));
                            menuItem2.setFont(menuItem2.getFont().deriveFont(menuItem2.getFont().getSize() + 5f));
                            menu7.add(menuItem2);

                            //---- menuItem3 ----
                            menuItem3.setText(bundle.getString("HomePage.menuItem3.text"));
                            menuItem3.setFont(menuItem3.getFont().deriveFont(menuItem3.getFont().getSize() + 5f));
                            menu7.add(menuItem3);

                            //---- menuItem4 ----
                            menuItem4.setText(bundle.getString("HomePage.menuItem4.text"));
                            menuItem4.setFont(menuItem4.getFont().deriveFont(menuItem4.getFont().getSize() + 5f));
                            menu7.add(menuItem4);
                        }
                        menuBar4.add(menu7);

                        //======== menu8 ========
                        {
                            menu8.setText(bundle.getString("HomePage.menu8.text"));
                            menu8.setFont(menu8.getFont().deriveFont(menu8.getFont().getSize() + 10f));
                            menu8.setBackground(SystemColor.activeCaption);

                            //---- menuItem5 ----
                            menuItem5.setText(bundle.getString("HomePage.menuItem5.text"));
                            menuItem5.setFont(menuItem5.getFont().deriveFont(menuItem5.getFont().getSize() + 5f));
                            menu8.add(menuItem5);

                            //---- menuItem6 ----
                            menuItem6.setText(bundle.getString("HomePage.menuItem6.text"));
                            menuItem6.setFont(menuItem6.getFont().deriveFont(menuItem6.getFont().getSize() + 5f));
                            menu8.add(menuItem6);

                            //---- menuItem7 ----
                            menuItem7.setText(bundle.getString("HomePage.menuItem7.text"));
                            menuItem7.setFont(menuItem7.getFont().deriveFont(menuItem7.getFont().getSize() + 5f));
                            menu8.add(menuItem7);

                            //---- menuItem8 ----
                            menuItem8.setText(bundle.getString("HomePage.menuItem8.text"));
                            menuItem8.setFont(menuItem8.getFont().deriveFont(menuItem8.getFont().getSize() + 5f));
                            menu8.add(menuItem8);
                        }
                        menuBar4.add(menu8);

                        //======== menu9 ========
                        {
                            menu9.setText(bundle.getString("HomePage.menu9.text"));
                            menu9.setFont(menu9.getFont().deriveFont(menu9.getFont().getSize() + 10f));
                            menu9.setBackground(SystemColor.activeCaption);

                            //---- menuItem9 ----
                            menuItem9.setText(bundle.getString("HomePage.menuItem9.text"));
                            menuItem9.setFont(menuItem9.getFont().deriveFont(menuItem9.getFont().getSize() + 5f));
                            menu9.add(menuItem9);

                            //---- menuItem10 ----
                            menuItem10.setText(bundle.getString("HomePage.menuItem10.text"));
                            menuItem10.setFont(menuItem10.getFont().deriveFont(menuItem10.getFont().getSize() + 5f));
                            menu9.add(menuItem10);

                            //---- menuItem11 ----
                            menuItem11.setText(bundle.getString("HomePage.menuItem11.text"));
                            menuItem11.setFont(menuItem11.getFont().deriveFont(menuItem11.getFont().getSize() + 5f));
                            menu9.add(menuItem11);

                            //---- menuItem12 ----
                            menuItem12.setText(bundle.getString("HomePage.menuItem12.text"));
                            menuItem12.setFont(menuItem12.getFont().deriveFont(menuItem12.getFont().getSize() + 5f));
                            menu9.add(menuItem12);
                        }
                        menuBar4.add(menu9);

                        //======== menu10 ========
                        {
                            menu10.setText(bundle.getString("HomePage.menu10.text"));
                            menu10.setFont(menu10.getFont().deriveFont(menu10.getFont().getSize() + 10f));
                            menu10.setBackground(SystemColor.activeCaption);

                            //---- menuItem13 ----
                            menuItem13.setText(bundle.getString("HomePage.menuItem13.text"));
                            menuItem13.setFont(menuItem13.getFont().deriveFont(menuItem13.getFont().getSize() + 5f));
                            menu10.add(menuItem13);

//                            //---- menuItem14 ----
//                            menuItem14.setText(bundle.getString("HomePage.menuItem14.text"));
//                            menuItem14.setFont(menuItem14.getFont().deriveFont(menuItem14.getFont().getSize() + 5f));
//                            menu10.add(menuItem14);
//
//                            //---- menuItem15 ----
//                            menuItem15.setText(bundle.getString("HomePage.menuItem15.text"));
//                            menuItem15.setFont(menuItem15.getFont().deriveFont(menuItem15.getFont().getSize() + 5f));
//                            menu10.add(menuItem15);
//
                            //---- menuItem16 ----
                            menuItem16.setText(bundle.getString("HomePage.menuItem16.text"));
                            menuItem16.setFont(menuItem16.getFont().deriveFont(menuItem16.getFont().getSize() + 5f));
                            menu10.add(menuItem16);
                        }
                        menuBar4.add(menu10);

                        //======== menu11 ========
                        {
                            menu11.setText(bundle.getString("HomePage.menu11.text"));
                            menu11.setFont(menu11.getFont().deriveFont(menu11.getFont().getSize() + 10f));
                            menu11.setBackground(SystemColor.activeCaption);

                            //---- menuItem17 ----
                            menuItem17.setText(bundle.getString("HomePage.menuItem17.text"));
                            menuItem17.setFont(menuItem17.getFont().deriveFont(menuItem17.getFont().getSize() + 5f));
                            menu11.add(menuItem17);

                            //---- menuItem18 ----
                            menuItem18.setText(bundle.getString("HomePage.menuItem18.text"));
                            menuItem18.setFont(menuItem18.getFont().deriveFont(menuItem18.getFont().getSize() + 5f));
                            menu11.add(menuItem18);

                            //---- menuItem19 ----
                            menuItem19.setText(bundle.getString("HomePage.menuItem19.text"));
                            menuItem19.setFont(menuItem19.getFont().deriveFont(menuItem19.getFont().getSize() + 5f));
                            menu11.add(menuItem19);

                            //---- menuItem20 ----
                            menuItem20.setText(bundle.getString("HomePage.menuItem20.text"));
                            menuItem20.setFont(menuItem20.getFont().deriveFont(menuItem20.getFont().getSize() + 5f));
                            menu11.add(menuItem20);
                        }
                        menuBar4.add(menu11);

                        //======== menu12 ========
//                        {
//                            menu12.setText(bundle.getString("HomePage.menu12.text"));
//                            menu12.setFont(menu12.getFont().deriveFont(menu12.getFont().getSize() + 10f));
//                            menu12.setBackground(SystemColor.activeCaption);
//
//                            //---- menuItem23 ----
//                            menuItem23.setText(bundle.getString("HomePage.menuItem23.text"));
//                            menuItem23.setFont(menuItem23.getFont().deriveFont(menuItem23.getFont().getSize() + 5f));
//                            menu12.add(menuItem23);
//
//                            //---- menuItem22 ----
//                            menuItem22.setText(bundle.getString("HomePage.menuItem22.text"));
//                            menuItem22.setFont(menuItem22.getFont().deriveFont(menuItem22.getFont().getSize() + 5f));
//                            menu12.add(menuItem22);
//
//                            //---- menuItem21 ----
//                            menuItem21.setText(bundle.getString("HomePage.menuItem21.text"));
//                            menuItem21.setFont(menuItem21.getFont().deriveFont(menuItem21.getFont().getSize() + 5f));
//                            menu12.add(menuItem21);
//                        }
//                        menuBar4.add(menu12);
                    }
                    panel1.add(menuBar4, BorderLayout.NORTH);

                    //======== panel7 ========
                    {
                        panel7.setLayout(new CardLayout());

                        //======== panel8 ========
                        {
                            panel8.setLayout(new BorderLayout());

                            //======== panel9 ========
                            {
                                panel9.setBackground(SystemColor.inactiveCaption);
                                panel9.setLayout(new GridLayout(5, 1));

                                //======== panel21 ========
                                {
                                    panel21.setBackground(SystemColor.activeCaption);
                                    panel21.setLayout(new GridLayout(1, 1));

                                    //---- label10 ----
                                    label10.setText(bundle.getString("HomePage.label10.text"));
                                    label10.setFont(label10.getFont().deriveFont(label10.getFont().getSize() + 13f));
                                    label10.setForeground(Color.white);
                                    panel21.add(label10);
                                }
                                panel9.add(panel21);

                                //======== panel16 ========
                                {
                                    panel16.setBackground(SystemColor.inactiveCaption);
                                    panel16.setLayout(new GridLayout(1, 1));

                                    //---- button2 ----
                                    button2.setText(bundle.getString("HomePage.button2.text"));
                                    button2.setFont(button2.getFont().deriveFont(button2.getFont().getSize() + 8f));
                                    button2.setIcon(new ImageIcon(getClass().getResource("/image/\u7528\u6237\u7ba1\u7406.png")));
                                    panel16.add(button2);
                                }
                                panel9.add(panel16);

                                //======== panel17 ========
                                {
                                    panel17.setBackground(SystemColor.inactiveCaption);
                                    panel17.setLayout(new GridLayout(1, 1));

                                    //---- button3 ----
                                    button3.setText(bundle.getString("HomePage.button3.text"));
                                    button3.setFont(button3.getFont().deriveFont(button3.getFont().getSize() + 8f));
                                    button3.setIcon(new ImageIcon(getClass().getResource("/image/\u7ba1\u7406\u5458-\u7528\u6237\u67e5\u8be2.png")));
                                    panel17.add(button3);
                                }
                                panel9.add(panel17);

                                //======== panel18 ========
                                {
                                    panel18.setBackground(SystemColor.inactiveCaption);
                                    panel18.setLayout(new GridLayout(1, 1));

                                    //---- button4 ----
                                    button4.setText(bundle.getString("HomePage.button4.text"));
                                    button4.setFont(button4.getFont().deriveFont(button4.getFont().getSize() + 8f));
                                    button4.setIcon(new ImageIcon(getClass().getResource("/image/\u7cfb\u7edf\u7ba1\u7406.png")));
                                    panel18.add(button4);
                                }
                                panel9.add(panel18);

                                //======== panel19 ========
                                {
                                    panel19.setBackground(SystemColor.inactiveCaption);
                                    panel19.setLayout(new GridLayout(1, 1));

                                    //---- button5 ----
                                    button5.setText(bundle.getString("HomePage.button5.text"));
                                    button5.setFont(button5.getFont().deriveFont(button5.getFont().getSize() + 8f));
                                    button5.setIcon(new ImageIcon(getClass().getResource("/image/\u9000\u51fa.png")));
                                    panel19.add(button5);
                                }
                                panel9.add(panel19);
                            }
                            panel8.add(panel9, BorderLayout.WEST);

                            //======== panel2 ========
                            {
                                panel2.setForeground(SystemColor.inactiveCaption);
                                panel2.setLayout(new GridLayout(2, 1));

                                //======== panel3 ========
                                {
                                    panel3.setBackground(SystemColor.inactiveCaption);
                                    panel3.setLayout(new GridLayout(1, 1));
                                }
                                panel2.add(panel3);

                                //======== panel4 ========
                                {
                                    panel4.setBackground(SystemColor.inactiveCaption);
                                    panel4.setLayout(new GridLayout(1, 2));

                                    //---- label1 ----
                                    label1.setText(bundle.getString("HomePage.label1.text"));
                                    label1.setHorizontalAlignment(SwingConstants.CENTER);
                                    panel4.add(label1);
                                    panel4.add(label2);

                                    //---- label2 ----
                                    //label2.setBounds(150,63,500,800);
                                    label2.setHorizontalAlignment(SwingConstants.RIGHT);
                                    Font font1=new Font("微软雅黑",Font.CENTER_BASELINE,11);
                                    label2.setFont(font1);
                                    panel4.add(label2);
                                    Util.setTimer(label2);
                                }
                                panel2.add(panel4);
                            }
                            panel8.add(panel2, BorderLayout.SOUTH);

                            //======== panel5 ========
                            {
                                panel5.setLayout(new CardLayout());

                                //---- label3 ----
                                label3.setIcon(new ImageIcon(getClass().getResource("/image/\u80cc\u666f.png")));
                                panel5.add(label3, "card1");
                            }
                            panel8.add(panel5, BorderLayout.CENTER);
                        }
                        panel7.add(panel8, "card1");
                    }
                    panel1.add(panel7, BorderLayout.CENTER);
                }
                contentPanel.add(panel1);
            }
            dialogPane.add(contentPanel, BorderLayout.CENTER);
        }
        contentPane.add(dialogPane, BorderLayout.CENTER);
        setLocationRelativeTo(null);

        menuItem1.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new ClassAddPage().setVisible(true);
            }
        });

        menuItem2.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new ClassSelectPage().setVisible(true);
            }
        });

        menuItem3.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new ClassModifyPage().setVisible(true);
            }
        });

        menuItem4.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new ClassDeletePage().setVisible(true);
            }
        });

        menuItem5.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new CourseAddPage().setVisible(true);
            }
        });

        menuItem6.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new CourseSelectPageT().setVisible(true);
            }
        });

        menuItem7.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new CourseModifyPage().setVisible(true);
            }
        });

        menuItem8.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new CourseDeletePage().setVisible(true);
            }
        });

        menuItem9.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new StudentAddPage().setVisible(true);
            }
        });

        menuItem10.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new StudentSelectPage().setVisible(true);
            }
        });

        menuItem11.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new StudentModifyPage().setVisible(true);
            }
        });

        menuItem12.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new StudentDeletePage().setVisible(true);
            }
        });

        menuItem13.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new TCourseChoosePage().setVisible(true);
            }
        });

        menuItem16.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new TCourseChooseDeletePage().setVisible(true);
            }
        });

        menuItem17.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new ScoreAddPage().setVisible(true);
            }
        });

        menuItem18.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new ScoreSelectPageT().setVisible(true);
            }
        });

        menuItem19.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new ScoreModifyPage().setVisible(true);
            }
        });

        menuItem20.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new ScoreDeletePage().setVisible(true);
            }
        });

        button2.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new TRegisterPage().setVisible(true);
                setVisible(false);
            }
        });

        button3.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new UserSelectPageT().setVisible(true);
            }
        });

        button4.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                new LoginPage().setVisible(true);
                setVisible(false);
            }
        });

        button5.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }
        });
    }

    public static void main(String[] args) {
        new THomePage().setVisible(true);
    }
}
